package tvdi

class Modulo {

	String nome
	Date dataInicio
	Date dataFim
	Integer maximoAlunos
	Integer cargaHoraria
	Date dateCreated
	Date lastUpdated
	Curso curso
    static constraints = {
		nome(blank:false, nullable:false, unique:true)
		dataInicio(blank:false)
		dataFim(blank:false)
		maximoAlunos(min:0)
		cargaHoraria(blank:false, nullable:false, min:1)
    }
        
    static belongsTo = [Curso]
    static hasMany = [alunos:Aluno]
    
    static mapping = {
		sort "dataInicio"
    }
    
    String toString(){
		return "${nome}"
	}
}
